function [y,A,ind] = constructEqu3(I,delta)
%UNTITLED2 此处显示有关此函数的摘要
%   此处显示详细说明
[M,N,kI] = size(I);
J = M*N;
% y = reshape(I,J,kI);
%% 以~nan为真，将多帧图像进行 与 操作。剩下的就是所有帧都有的像素了

%%
%去除nan
y1 = I(~isnan(I));
for f = 1:kI
    ind1 = find(~isnan(I(:,:,f)));
    if f ==1
        ind = ind1;
    end
    ind = intersect(ind, ind1);%找出共同的元素
end

if numel(ind)<1 %|| mod(numel(y1), kI)~=0
    y=[];
    A=[];
    return;
end
y=zeros(numel(ind),kI);
[u,v] = ind2sub(size(I(:,:,1)), ind);
for f =1:kI
%     yf = I(sub2ind(size(I(:,:,1)),x,y),f);
    If=I(:,:,f);
    yf = If(sub2ind(size(If),u,v));
    y(:,f) = yf;
%     if f==1
%         y=yf;
%     else
%         y=[y;yf];
%     end    
end
% y =reshape(y1,[],kI);
% y = reshape(I,J,kI);
y=y';
A = zeros(kI,3);
for m=1:kI
    A(m,1)=1;
    A(m,2)=cos(delta(m));
    A(m,3)=-sin(delta(m));
end
% disp(A);

end
         